﻿using System.Windows;
using System.Collections;

namespace ListBox_binding {

  public partial class MainWindow : Window {
    public MainWindow() {
      InitializeComponent();
      DataContext = data_;
    }

    private void add_Click(object sender, RoutedEventArgs e) {
      data_.add(textBox.Text);
    }

    private void remove_Click(object sender, RoutedEventArgs e) {
      data_.remove_at(listBox.SelectedIndex);
    }

    private BindData data_ = new BindData();
  }

}